﻿using UnityEngine;
using System.Collections;

public class GestureExpandDebuger : MonoBehaviour {



    public UnityEngine.UI.Slider debugSliderHandDistance;
    public UnityEngine.UI.Text debugTextHandDistance;
    public UnityEngine.UI.Slider debugSliderHandVelocity;
    public UnityEngine.UI.Text debugTextHandVelocity;

    // Use this for initialization
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        GestureBase gestureInterface = this.GetComponent<GestureExpand>();
        RefreshDistanceLabel(gestureInterface);

    }
    private void RefreshDistanceLabel(GestureBase gestureInterface)
    {
        if (debugSliderHandDistance != null)
        {
            debugSliderHandDistance.minValue = gestureInterface.fMinValue;
            debugSliderHandDistance.maxValue = gestureInterface.fMaxValue;
            debugSliderHandDistance.value = gestureInterface.fValue;
        }
        if (debugTextHandDistance != null)
        {
            string msg = string.Format("Expand = {0:f2}", gestureInterface.fValue);
            debugTextHandDistance.text = msg;
        }

        if (debugSliderHandVelocity != null)
        {
            debugSliderHandVelocity.minValue = gestureInterface.fMinVelocity;
            debugSliderHandVelocity.maxValue = gestureInterface.fMaxVelocity;
            debugSliderHandVelocity.value = gestureInterface.fVelocity;
        }
        if (debugTextHandVelocity != null)
        {
            string msg = string.Format("Velocity = {0:f2}", gestureInterface.fVelocity);
            debugTextHandVelocity.text = msg;
        }
    }
}
